package org.ftc.domain;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.GenericGenerator;

/**
 * 委員名單
 * @author Creasy Ho
 *
 */
@Entity
@Table(name = "COMMITTEE")
//@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Committee implements Serializable  {


	/**
	 * 
	 */
	private static final long serialVersionUID = -5951994633736184672L;

	@Id 
	@Column(name = "CODE", length = 50 )
	@GeneratedValue(generator = "uuid")
	@GenericGenerator(name = "uuid", strategy = "uuid2")
	private String code;
	
	//問題名稱
	@Column(name = "NAME" , length = 50 )
	private String name;
	
	@Column(name = "SORT") 
	private Integer sort;
	
	@JsonIgnore
	@OneToMany(mappedBy = "committee",cascade = CascadeType.ALL,fetch = FetchType.LAZY)
	private Set<CTMap> emMapping = new HashSet<CTMap>(0);

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public Set<CTMap> getEmMapping() {
		return emMapping;
	}

	public void setEmMapping(Set<CTMap> emMapping) {
		this.emMapping = emMapping;
	}
	
	
	
}
